bitkeeper revision 1.1159.1.513 (41d408a3JUgu3aO0DUVuu6Cdvk-wig)
authorsmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>
Thu, 30 Dec 2004 13:54:43 +0000 (13:54 +0000)
committersmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>
Thu, 30 Dec 2004 13:54:43 +0000 (13:54 +0000)
update for 2.6 smp changes

linux-2.4.28-xen-sparse/arch/xen/mm/fault.c
linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c
linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c
linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h
linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h

index 76d95ff03a718f505447d2295e5cd0ed03940865..d19218fe3237b16a913356a9b80d1a0716cb441e 100644 (file)
@@ -84,8 +84,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs,
         error_code &= 3;
         error_code |= (regs->xcs & 2) << 1;
 
-       if ( flush_page_update_queue() != 0 )
-               return;
+       /* ensure all updates have completed */
+       flush_page_update_queue();
 
        /*
         * We fault-in kernel-space virtual memory on-demand. The
index c6c7bafef918c6d69991b1f3c19c0cca81dbca65..9068960f051e541524e0773eed185cf8099428f9 100644 (file)
@@ -36,7 +36,9 @@
 #include <asm-xen/hypervisor.h>
 #include <asm-xen/multicall.h>
 #include <asm-xen/balloon.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 #include <linux/percpu.h>
+#endif
 
 /*
  * This suffices to protect us if we ever move to SMP domains.
index f1a3b178872a6f30d862eac12a00b9372cc3949a..9e3b8d06b7baa58ecfaa17213afe7c0b6f7dc6d0 100644 (file)
@@ -42,7 +42,6 @@
 #include <asm-xen/xen-public/physdev.h>
 #include <asm-xen/ctrl_if.h>
 #include <asm-xen/hypervisor.h>
-#define XEN_EVTCHN_MASK_OPS
 #include <asm-xen/evtchn.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -64,6 +63,9 @@ static int irq_to_evtchn[NR_IRQS];
 DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]);
 
 /* evtchn <-> IPI mapping. */
+#ifndef NR_IPIS    // XXX SMH: temp fix for 2.4 
+#define NR_IPIS 1 
+#endif
 DEFINE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
 
 /* Reference counts for bindings to IRQs. */
index a85bf4ba61c316dcaa11dfa520d53de61a5222b5..59a7ba3991c53ba4410395ce88d8462e04898fee 100644 (file)
@@ -48,8 +48,6 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
 /* Entry point for notifications into the userland character device. */
 void evtchn_device_upcall(int port);
 
-#ifdef XEN_EVTCHN_MASK_OPS
-
 static inline void mask_evtchn(int port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
@@ -76,8 +74,6 @@ static inline void unmask_evtchn(int port)
     }
 }
 
-#endif /* XEN_EVTCHN_MASK_OPS */
-
 static inline void clear_evtchn(int port)
 {
     shared_info_t *s = HYPERVISOR_shared_info;
index 024452bdbd6f43243ec64b4fe7fc6ebeee79a0fe..e54caa1b99485f73368f8f67a4ebc9a62c7dce8c 100644 (file)
@@ -91,6 +91,23 @@ void xen_set_ldt(unsigned long ptr, unsigned long bytes);
 void xen_machphys_update(unsigned long mfn, unsigned long pfn);
 
 void _flush_page_update_queue(void);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+/* 
+** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just 
+** include sufficient #defines to allow the below to build. 
+*/
+#define DEFINE_PER_CPU(type, name) \
+    __typeof__(type) per_cpu__##name
+
+#define per_cpu(var, cpu)           (*((void)cpu, &per_cpu__##var))
+#define __get_cpu_var(var)          per_cpu__##var
+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
+
+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+#endif /* linux < 2.6.0 */
+
 #define flush_page_update_queue() do {                         \
     DECLARE_PER_CPU(unsigned int, mmu_update_queue_idx);       \
     if (per_cpu(mmu_update_queue_idx, smp_processor_id()))     \